package com.fire.control.system.module.warning.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.fire.control.system.entity.WarningLevel;
/**
 * 
 * @ClassName:  WarningLevelRepository
 * @Description:  报警模式设置持久层
 * @author:  xiechengguang
 * @date:  2017年5月22日 下午4:26:59
 *
 */
@Repository
public interface WarningLevelRepository extends JpaRepository<WarningLevel, String> {
	@Transactional
	@Modifying
	@Query("update WarningLevel w set w.status = false where w.id = :id")
	public int updateWarningLevelStatus(@Param("id") String id);
	
	@Query("from WarningLevel w where w.status = true")
	public List<WarningLevel> getWarningLevelList();
}
